<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>九九乘法表</title>
<style>
.odd{
background-color: #f0f0f0;
font-weight: bold;
}
</style>
</head>
<body>
<h2>九九乘法表</h2>
<div id="table"></div>
<script>
let table=document.getElementById('table');

for(let i=1;i<=9;i++){
let row=document.createElement('div');
if(i%2===1)row.className='odd';

for(let j=1;j<=i;j++){
row.innerHTML+=`${j}*${i}=${j*i}&nbsp;&nbsp;&nbsp;`;
}

table.appendChild(row);
}
</script>
</body>
</html>
未选择文件